package mapeamentos.modelo.beans;

import java.io.Serializable;

import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

public class AlunoVideoAulaPK implements Serializable {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1812714554732815919L;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="id_aluno")
	private Aluno aluno;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="id_videoaula")
	private VideoAula videoaula;

	public Aluno getAluno() {
		return aluno;
	}

	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
	}

	public VideoAula getVideoaula() {
		return videoaula;
	}

	public void setVideoaula(VideoAula videoaula) {
		this.videoaula = videoaula;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((aluno == null) ? 0 : aluno.hashCode());
		result = prime * result
				+ ((videoaula == null) ? 0 : videoaula.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AlunoVideoAulaPK other = (AlunoVideoAulaPK) obj;
		if (aluno == null) {
			if (other.aluno != null)
				return false;
		} else if (!aluno.equals(other.aluno))
			return false;
		if (videoaula == null) {
			if (other.videoaula != null)
				return false;
		} else if (!videoaula.equals(other.videoaula))
			return false;
		return true;
	}
}
